package com.loongtech.bi.entity.system;

import com.loongtech.core.gen.GenInnerK;
import com.loongtech.core.jpa.entity.EntityIntAutoWithoutVersion;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

@Entity
@Table(name = "system_role_function", indexes = {@Index(name = "index_system_role_function", columnList = "roleId,functionId")})
@GenInnerK
public class EntitySysRoleFunction extends EntityIntAutoWithoutVersion {
	private static final long serialVersionUID = 1L;
    @Column(columnDefinition = "int(11) NOT NULL default 0")
    private Integer roleId;
    @Column(columnDefinition = "int(11) NOT NULL default 0")
    private int functionId;
    @Column(columnDefinition = "tinyint(1)  default 1")
    private boolean insertTag;
    @Column(columnDefinition = "tinyint(1)  default 1")
    private boolean updateTag;
    @Column(columnDefinition = "tinyint(1)  default 1")
    private boolean editTag;
    @Column(columnDefinition = "varchar(255)")
    private String filter1; //渠道过滤名称
    @Column(columnDefinition = "varchar(255)")
    private String filterVal1; //渠道过滤值
    @Column(columnDefinition = "varchar(255)")
    private String filter2; //代理商过滤名称
    @Column(columnDefinition = "varchar(255)")
    private String filterVal2; //代理商过滤值
    @Column(columnDefinition = "varchar(255)")
    private String filter3; //系统过滤名称
    @Column(columnDefinition = "varchar(255)")
    private String filterVal3; //系统过滤值

    private int version = 1;			//乐观锁

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }


    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public int getFunctionId() {
        return functionId;
    }

    public void setFunctionId(int functionId) {
        this.functionId = functionId;
    }

    public boolean isInsertTag() {
        return insertTag;
    }

    public void setInsertTag(boolean insertTag) {
        this.insertTag = insertTag;
    }

    public boolean isUpdateTag() {
        return updateTag;
    }

    public void setUpdateTag(boolean updateTag) {
        this.updateTag = updateTag;
    }

    public boolean isEditTag() {
        return editTag;
    }

    public void setEditTag(boolean editTag) {
        this.editTag = editTag;
    }

    public String getFilter1() {
        return filter1;
    }

    public void setFilter1(String filter1) {
        this.filter1 = filter1;
    }

    public String getFilterVal1() {
        return filterVal1;
    }

    public void setFilterVal1(String filterVal1) {
        this.filterVal1 = filterVal1;
    }

    public String getFilter2() {
        return filter2;
    }

    public void setFilter2(String filter2) {
        this.filter2 = filter2;
    }

    public String getFilterVal2() {
        return filterVal2;
    }

    public void setFilterVal2(String filterVal2) {
        this.filterVal2 = filterVal2;
    }

    public String getFilter3() {
        return filter3;
    }

    public void setFilter3(String filter3) {
        this.filter3 = filter3;
    }

    public String getFilterVal3() {
        return filterVal3;
    }

    public void setFilterVal3(String filterVal3) {
        this.filterVal3 = filterVal3;
    }

    @Override
    public String toString() {
        return "EntitySysRoleFunction{" +
                "id=" + id +
                ", roleId=" + roleId +
                ", functionId=" + functionId +
                ", insertTag=" + insertTag +
                ", updateTag=" + updateTag +
                ", editTag=" + editTag +
                ", filter1='" + filter1 + '\'' +
                ", filterVal1='" + filterVal1 + '\'' +
                ", filter2='" + filter2 + '\'' +
                ", filterVal2='" + filterVal2 + '\'' +
                ", filter3='" + filter3 + '\'' +
                ", filterVal3='" + filterVal3 + '\'' +
                '}';
    }

    public static class K {
        public static final String roleId = "roleId";
        public static final String functionId = "functionId";
        public static final String insertTag = "insertTag";
        public static final String updateTag = "updateTag";
        public static final String editTag = "editTag";
        public static final String id = "id";
        public static final String version = "version";

        //roleId, functionId, insertTag, updateTag, editTag, id, version,
        public static java.util.List<String> toList() {
            java.util.List<String> list = new java.util.ArrayList<>();
            list.add(roleId);
            list.add(functionId);
            list.add(insertTag);
            list.add(updateTag);
            list.add(editTag);
            list.add(id);
            list.add(version);
            return list;
        }
    }
}